package com.pro.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.pro.domain.Film;
import com.pro.mapper.FilmMapper;
import com.pro.service.FilmService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class FilmServiceImpl implements FilmService {

    @Autowired
    private FilmMapper filmMapper;

    @Override
    public List<Film> queryAllFilms() {
        QueryWrapper<Film> queryWrapper = new QueryWrapper<Film>();
        return filmMapper.selectList(queryWrapper);
    }

    @Override
    public Film queryFilmByFilmId(Long filmId) {
        return filmMapper.selectById(filmId);
    }
}
